- /* sdclog10.cpp by K.Tsuru */
- // function ID 3522 DARDIX
- // constant log(10)
- /*************************
- In header "snmath.h" the function prototype is declared below
- --------
- SDouble Log10(const SDouble* ln10 = NULL, SDouble (*pfCalcFunc)() = SNLog10);
- --------
- Remade at version 2.30.
- **************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- static SDouble* ln10 = NULL; //keep in the static memory
- static uint ln10Size = 0;
- void Log10Free(){
- if(ln10Size == 0) return;
- delete ln10; ln10 = NULL; ln10Size = 0;
- }
- uint Log10Size() { return ln10Size; }
- SDouble Log10(const SDouble* userln10, SDouble (*pfCalcFunc)()){
- if(ln10 == NULL) ln10 = new SDouble;
- uint curMaxSize = ln10->MaxSize(); // current max size
- if( ln10Size < curMaxSize ){ // renew
- #if UsesSNConstantFile
- if(userln10 == NULL){ //called by default argument
- int enough;
- /**********************************************************************************
- UpdateConstantFile() recursively calls this function Log10() via SetConstByFile()
- of which userln10 != NULL, then does not come here and processing below has been
- done.
- **********************************************************************************/
- enough = UpdateConstantFile(Log10_FILE, Log10, pfCalcFunc, curMaxSize);
- if(enough != NO_SNC_FILE) return *ln10;
- }
- #endif
- ln10->ShowMessage("Evaluating Log10() now.....");
- EntryConst(userln10, ln10, pfCalcFunc, &ln10Size);
- ln10->ShowMessage(" Finished.\n"); // ver. 2.17
-
- ln10Size = curMaxSize;
- }
- return *ln10;
- }
sdclog10.cpp : last modifiled at 2017/06/23 10:57:39(1,564 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).